<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NeuZephyr: NeuZephyr::Nodes::Standard::InputNode Class Reference</title>
<link rel="icon" href="NZ_logo2.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="NZ_logo2.png"/></td>
  <td id="projectalign">
   <div id="projectname">NeuZephyr
   </div>
   <div id="projectbrief">Simple DL Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>NeuZephyr</b></li><li class="navelem"><a class="el" href="namespace_neu_zephyr_1_1_nodes.html">Nodes</a></li><li class="navelem"><a class="el" href="namespace_neu_zephyr_1_1_nodes_1_1_standard.html">Standard</a></li><li class="navelem"><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html">InputNode</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">NeuZephyr::Nodes::Standard::InputNode Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Represents an input node in a computational graph.  
 <a href="#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for NeuZephyr::Nodes::Standard::InputNode:</div>
<div class="dyncontent">
<div class="center"><img src="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node__inherit__graph.png" border="0" usemap="#a_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_inherit__map" alt="Inheritance graph"/></div>
<map name="a_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_inherit__map" id="a_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_inherit__map">
<area shape="rect" title="Represents an input node in a computational graph." alt="" coords="5,80,197,123"/>
<area shape="rect" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph." alt="" coords="16,5,186,32"/>
<area shape="poly" title=" " alt="" coords="104,48,104,80,98,80,98,48"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for NeuZephyr::Nodes::Standard::InputNode:</div>
<div class="dyncontent">
<div class="center"><img src="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node__coll__graph.png" border="0" usemap="#a_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_coll__map" alt="Collaboration graph"/></div>
<map name="a_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_coll__map" id="a_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_coll__map">
<area shape="rect" title="Represents an input node in a computational graph." alt="" coords="5,80,197,123"/>
<area shape="rect" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph." alt="" coords="16,5,186,32"/>
<area shape="poly" title=" " alt="" coords="104,48,104,80,98,80,98,48"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1efa62deda3dd4f8cc7a4e446658a084" id="r_a1efa62deda3dd4f8cc7a4e446658a084"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1efa62deda3dd4f8cc7a4e446658a084">InputNode</a> (const Tensor::shape_type &amp;shape, bool requires_grad=false)</td></tr>
<tr class="memdesc:a1efa62deda3dd4f8cc7a4e446658a084"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor to initialize an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with a specified shape and gradient requirement.  <br /></td></tr>
<tr class="separator:a1efa62deda3dd4f8cc7a4e446658a084"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d4137ef13281622417e64f9e47a0db3" id="r_a9d4137ef13281622417e64f9e47a0db3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9d4137ef13281622417e64f9e47a0db3">InputNode</a> (const <a class="el" href="class_neu_zephyr_1_1_data_1_1_tensor.html">Tensor</a> &amp;tensor)</td></tr>
<tr class="memdesc:a9d4137ef13281622417e64f9e47a0db3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor to initialize an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with an existing <code>Tensor</code>.  <br /></td></tr>
<tr class="separator:a9d4137ef13281622417e64f9e47a0db3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2b4ad91c79c9b8c06a78c39e60d1be8" id="r_af2b4ad91c79c9b8c06a78c39e60d1be8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af2b4ad91c79c9b8c06a78c39e60d1be8">InputNode</a> (const std::initializer_list&lt; int &gt; &amp;shape, bool requires_grad=false)</td></tr>
<tr class="memdesc:af2b4ad91c79c9b8c06a78c39e60d1be8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor to initialize an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with a shape specified by an initializer list.  <br /></td></tr>
<tr class="separator:af2b4ad91c79c9b8c06a78c39e60d1be8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cae07ac7fd85e6254d98484dd5f1a43" id="r_a4cae07ac7fd85e6254d98484dd5f1a43"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43">forward</a> () override</td></tr>
<tr class="memdesc:a4cae07ac7fd85e6254d98484dd5f1a43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Forward pass for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>.  <br /></td></tr>
<tr class="separator:a4cae07ac7fd85e6254d98484dd5f1a43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb66433b01288b4e0b5d1696e4060aa5" id="r_afb66433b01288b4e0b5d1696e4060aa5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5">backward</a> () override</td></tr>
<tr class="memdesc:afb66433b01288b4e0b5d1696e4060aa5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Backward pass for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>.  <br /></td></tr>
<tr class="separator:afb66433b01288b4e0b5d1696e4060aa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_neu_zephyr_1_1_nodes_1_1_node"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_class_neu_zephyr_1_1_nodes_1_1_node')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html">NeuZephyr::Nodes::Node</a></td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents an input node in a computational graph. </p>
<p>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> class is a subclass of <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph.">Node</a></code>, representing a node that holds the input data for a neural network or computational graph. It is designed to store the input tensor and pass it forward through the graph. <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not perform any computations in the forward or backward passes; its main role is to provide input data to the network.</p>
<p>Key features:</p><ul>
<li><b>Tensor Output</b>: The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> stores a <code>Tensor</code> as its output, which is initialized either from a shape or an existing tensor.</li>
<li><b>No Forward or Backward Operations</b>: The <code><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a></code> and <code><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5" title="Backward pass for the InputNode.">backward()</a></code> methods are implemented as empty, since this node only provides input data and does not modify the network during these passes.</li>
<li><b>Shape and Gradient Support</b>: The shape of the input tensor and whether it requires gradients is configurable during initialization.</li>
</ul>
<p>This class is part of the <code><a class="el" href="namespace_neu_zephyr_1_1_nodes.html" title="Contains classes and functionality for nodes in a neural network or computational graph.">NeuZephyr::Nodes</a></code> namespace and serves as a fundamental part of the computational graph, providing input data to the network during the forward pass.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>The <code><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a></code> and <code><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5" title="Backward pass for the InputNode.">backward()</a></code> methods are implemented but do not perform any operations for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>.</li>
<li>This class is designed to be used as the starting point of a computational graph, where other nodes depend on the input data provided by this node.</li>
</ul>
</dd></dl>
<h3><a class="anchor" id="autotoc_md37"></a>
Usage Example:</h3>
<div class="fragment"><div class="line"><span class="comment">// Example 1: Creating an InputNode with a specific shape</span></div>
<div class="line">Tensor::shape_type shape = {3, 3};  <span class="comment">// Define a 3x3 tensor</span></div>
<div class="line"><a class="code hl_class" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html">InputNode</a> input_node(shape, <span class="keyword">true</span>);  <span class="comment">// Create an InputNode with shape {3, 3} and requires_grad = true</span></div>
<div class="line">input_node.output-&gt;fill(0.5f);  <span class="comment">// Fill the input tensor with a value of 0.5</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Example 2: Creating an InputNode from an existing tensor</span></div>
<div class="line"><a class="code hl_class" href="class_neu_zephyr_1_1_data_1_1_tensor.html">Tensor</a> existing_tensor({2, 2});</div>
<div class="line">existing_tensor.<a class="code hl_function" href="class_neu_zephyr_1_1_data_1_1_tensor.html#af4ff38afec29592c56fe6eaa7d168c6f">fill</a>(1.0f);  <span class="comment">// Fill the existing tensor with 1.0</span></div>
<div class="line"><a class="code hl_function" href="#a1efa62deda3dd4f8cc7a4e446658a084">InputNode</a> input_node_from_tensor(existing_tensor);  <span class="comment">// Create an InputNode from the existing tensor</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Example 3: Using InputNode in a computational graph</span></div>
<div class="line"><a class="code hl_function" href="#a1efa62deda3dd4f8cc7a4e446658a084">InputNode</a> input_node({4, 4});  <span class="comment">// Create an InputNode with shape {4, 4}</span></div>
<div class="line">input_node.output-&gt;fill(2.0f);  <span class="comment">// Fill the tensor with the value 2.0</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// In the network, this node will pass the data to subsequent nodes during forward propagation.</span></div>
<div class="ttc" id="aclass_neu_zephyr_1_1_data_1_1_tensor_html"><div class="ttname"><a href="class_neu_zephyr_1_1_data_1_1_tensor.html">NeuZephyr::Data::Tensor</a></div><div class="ttdoc">A class for representing and manipulating multidimensional arrays (tensors) in GPU memory.</div><div class="ttdef"><b>Definition</b> <a href="_tensor_8cuh_source.html#l00134">Tensor.cuh:134</a></div></div>
<div class="ttc" id="aclass_neu_zephyr_1_1_data_1_1_tensor_html_af4ff38afec29592c56fe6eaa7d168c6f"><div class="ttname"><a href="class_neu_zephyr_1_1_data_1_1_tensor.html#af4ff38afec29592c56fe6eaa7d168c6f">NeuZephyr::Data::Tensor::fill</a></div><div class="ttdeci">void fill(const value_type value) const</div><div class="ttdoc">Fills the tensor's data with a specified value.</div><div class="ttdef"><b>Definition</b> <a href="_tensor_8cu_source.html#l00906">Tensor.cu:906</a></div></div>
<div class="ttc" id="aclass_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_html"><div class="ttname"><a href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html">NeuZephyr::Nodes::Standard::InputNode</a></div><div class="ttdoc">Represents an input node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l00260">Nodes.cuh:260</a></div></div>
<div class="ttc" id="aclass_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node_html_a1efa62deda3dd4f8cc7a4e446658a084"><div class="ttname"><a href="#a1efa62deda3dd4f8cc7a4e446658a084">NeuZephyr::Nodes::Standard::InputNode::InputNode</a></div><div class="ttdeci">InputNode(const Tensor::shape_type &amp;shape, bool requires_grad=false)</div><div class="ttdoc">Constructor to initialize an InputNode with a specified shape and gradient requirement.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cu_source.html#l00009">Nodes.cu:9</a></div></div>
</div><!-- fragment --><dl class="section author"><dt>Author</dt><dd>Mgepahmge (<a href="https://github.com/Mgepahmge">https://github.com/Mgepahmge</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024/11/29 </dd></dl>

<p class="definition">Definition at line <a class="el" href="_nodes_8cuh_source.html#l00260">260</a> of file <a class="el" href="_nodes_8cuh_source.html">Nodes.cuh</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a1efa62deda3dd4f8cc7a4e446658a084" name="a1efa62deda3dd4f8cc7a4e446658a084"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1efa62deda3dd4f8cc7a4e446658a084">&#9670;&#160;</a></span>InputNode() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">NeuZephyr::Nodes::Standard::InputNode::InputNode </td>
          <td>(</td>
          <td class="paramtype">const Tensor::shape_type &amp;</td>          <td class="paramname"><span class="paramname"><em>shape</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>requires_grad</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor to initialize an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with a specified shape and gradient requirement. </p>
<p>This constructor initializes an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> that holds a tensor with the specified shape. The tensor is created with the specified shape, and it can optionally track gradients if <code>requires_grad</code> is set to <code>true</code>. The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not perform any computations; its primary role is to hold and provide input data to the computational graph.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shape</td><td>The shape of the tensor to be stored in the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>. This defines the dimensions of the input data. </td></tr>
    <tr><td class="paramname">requires_grad</td><td>A boolean flag indicating whether the tensor should track gradients. Defaults to <code>false</code>.</td></tr>
  </table>
  </dd>
</dl>
<p>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> will store a <code>Tensor</code> object, initialized with the given shape and gradient tracking setting. This tensor can then be used as input for subsequent nodes in the computational graph.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> class does not perform any computations during the forward or backward passes. It simply stores and provides input data.</li>
<li><code>requires_grad</code> determines whether the input tensor will store gradients, which is useful if the input data is part of the network's parameters.</li>
</ul>
</dd></dl>
<dl class="section author"><dt>Author</dt><dd>Mgepahmge (<a href="https://github.com/Mgepahmge">https://github.com/Mgepahmge</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024/11/29 </dd></dl>

<p class="definition">Definition at line <a class="el" href="_nodes_8cu_source.html#l00009">9</a> of file <a class="el" href="_nodes_8cu_source.html">Nodes.cu</a>.</p>

</div>
</div>
<a id="a9d4137ef13281622417e64f9e47a0db3" name="a9d4137ef13281622417e64f9e47a0db3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d4137ef13281622417e64f9e47a0db3">&#9670;&#160;</a></span>InputNode() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">NeuZephyr::Nodes::Standard::InputNode::InputNode </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_neu_zephyr_1_1_data_1_1_tensor.html">Tensor</a> &amp;</td>          <td class="paramname"><span class="paramname"><em>tensor</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor to initialize an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with an existing <code>Tensor</code>. </p>
<p>This constructor initializes an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> using an existing <code>Tensor</code> object. The <code>Tensor</code> object is directly assigned to the <code>output</code> of the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>, allowing the node to use the provided tensor as its input data. The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not perform any computations but simply holds and provides the given tensor data to the computational graph.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tensor</td><td>The existing <code>Tensor</code> object to be used as the input for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>. This tensor contains the input data to be passed through the network.</td></tr>
  </table>
  </dd>
</dl>
<p>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> stores the provided tensor in its <code>output</code> member, which will be used by other nodes in the graph.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not modify the given tensor, it simply holds a reference to it.</li>
<li>This constructor is useful when you already have a tensor (e.g., loaded from a file or created elsewhere) and want to use it as input to the computational graph.</li>
</ul>
</dd></dl>
<dl class="section author"><dt>Author</dt><dd>Mgepahmge (<a href="https://github.com/Mgepahmge">https://github.com/Mgepahmge</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024/11/29 </dd></dl>

<p class="definition">Definition at line <a class="el" href="_nodes_8cu_source.html#l00014">14</a> of file <a class="el" href="_nodes_8cu_source.html">Nodes.cu</a>.</p>

</div>
</div>
<a id="af2b4ad91c79c9b8c06a78c39e60d1be8" name="af2b4ad91c79c9b8c06a78c39e60d1be8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2b4ad91c79c9b8c06a78c39e60d1be8">&#9670;&#160;</a></span>InputNode() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">NeuZephyr::Nodes::Standard::InputNode::InputNode </td>
          <td>(</td>
          <td class="paramtype">const std::initializer_list&lt; int &gt; &amp;</td>          <td class="paramname"><span class="paramname"><em>shape</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>requires_grad</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor to initialize an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with a shape specified by an initializer list. </p>
<p>This constructor initializes an <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> with a tensor whose shape is defined by an initializer list. The tensor is created with the given shape, and it can optionally track gradients if <code>requires_grad</code> is set to <code>true</code>. The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> class does not perform any computations; it simply holds and provides the input data to the network.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shape</td><td>An initializer list that defines the shape of the tensor. This specifies the dimensions of the input data. </td></tr>
    <tr><td class="paramname">requires_grad</td><td>A boolean flag indicating whether the tensor should track gradients. Defaults to <code>false</code>.</td></tr>
  </table>
  </dd>
</dl>
<p>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> will store a <code>Tensor</code> object, initialized with the given shape and gradient tracking setting. This tensor can then be used as the input to subsequent nodes in the computational graph.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>The <code><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a></code> and <code><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5" title="Backward pass for the InputNode.">backward()</a></code> methods in the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> are not used for computation, as this node only stores and provides input data.</li>
<li><code>requires_grad</code> determines whether the input tensor will store gradients, which is useful if the input data is part of the network's parameters or if you need to track the gradients for this node during backpropagation.</li>
</ul>
</dd></dl>
<dl class="section author"><dt>Author</dt><dd>Mgepahmge (<a href="https://github.com/Mgepahmge">https://github.com/Mgepahmge</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024/11/29 </dd></dl>

<p class="definition">Definition at line <a class="el" href="_nodes_8cu_source.html#l00019">19</a> of file <a class="el" href="_nodes_8cu_source.html">Nodes.cu</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="afb66433b01288b4e0b5d1696e4060aa5" name="afb66433b01288b4e0b5d1696e4060aa5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb66433b01288b4e0b5d1696e4060aa5">&#9670;&#160;</a></span>backward()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void NeuZephyr::Nodes::Standard::InputNode::backward </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Backward pass for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>. </p>
<p>The <code><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5" title="Backward pass for the InputNode.">backward()</a></code> method for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> is a no-op (no operation) because the input node does not participate in the backpropagation process. It does not have any parameters or gradients to update, as its role is simply to provide the input data to the computational graph.</p>
<p>Since the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not modify any data during the backward pass, the <code><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5" title="Backward pass for the InputNode.">backward()</a></code> method does not need to perform any operations, and it is left empty. Gradients will not be propagated from this node to any other nodes, as the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not require gradients.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>This method is a required implementation due to inheritance from the abstract <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph.">Node</a></code> class, but it does not perform any operations for <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>. It serves as a placeholder to conform to the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph.">Node</a></code> class interface.</li>
<li>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> is used to provide data to the computational graph, but since it doesn't have parameters, there is no need to propagate gradients through it.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a> for the <a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward</a> pass computation method.</dd></dl>
<dl class="section author"><dt>Author</dt><dd>Mgepahmge (<a href="https://github.com/Mgepahmge">https://github.com/Mgepahmge</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024/11/29 </dd></dl>

<p>Implements <a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html#a41914155871c84330701f9d1649b39f3">NeuZephyr::Nodes::Node</a>.</p>

<p class="definition">Definition at line <a class="el" href="_nodes_8cu_source.html#l00027">27</a> of file <a class="el" href="_nodes_8cu_source.html">Nodes.cu</a>.</p>

</div>
</div>
<a id="a4cae07ac7fd85e6254d98484dd5f1a43" name="a4cae07ac7fd85e6254d98484dd5f1a43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4cae07ac7fd85e6254d98484dd5f1a43">&#9670;&#160;</a></span>forward()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void NeuZephyr::Nodes::Standard::InputNode::forward </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Forward pass for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>. </p>
<p>The <code><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a></code> method for the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> is a no-op (no operation) because the input node does not perform any computations during the forward pass. Its primary role is to provide the input data to the computational graph.</p>
<p>Since the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> does not modify its data or perform any calculations, the <code><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a></code> method does not need to be implemented with any functionality, and it is left empty. The tensor stored in the <code>output</code> member will simply be passed along to the next nodes in the computational graph during the forward pass.</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>This method is a required implementation due to inheritance from the abstract <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph.">Node</a></code> class, but it does not perform any operations for <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code>. It serves as a placeholder to conform to the <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html" title="Base class for nodes in a neural network or computational graph.">Node</a></code> class interface.</li>
<li>The <code><a class="el" href="class_neu_zephyr_1_1_nodes_1_1_standard_1_1_input_node.html" title="Represents an input node in a computational graph.">InputNode</a></code> only holds input data, and its <code><a class="el" href="#a4cae07ac7fd85e6254d98484dd5f1a43" title="Forward pass for the InputNode.">forward()</a></code> method ensures that the data is available for the subsequent nodes in the graph.</li>
</ul>
</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#afb66433b01288b4e0b5d1696e4060aa5" title="Backward pass for the InputNode.">backward()</a> for the reverse propagation (gradient calculation) method.</dd></dl>
<dl class="section author"><dt>Author</dt><dd>Mgepahmge (<a href="https://github.com/Mgepahmge">https://github.com/Mgepahmge</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024/11/29 </dd></dl>

<p>Implements <a class="el" href="class_neu_zephyr_1_1_nodes_1_1_node.html#a64e42ba40199e35bfe453ef14b2d15c0">NeuZephyr::Nodes::Node</a>.</p>

<p class="definition">Definition at line <a class="el" href="_nodes_8cu_source.html#l00024">24</a> of file <a class="el" href="_nodes_8cu_source.html">Nodes.cu</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/C Program/Simple-CPP-DL-Framework/include/NeuZephyr/<a class="el" href="_nodes_8cuh_source.html">Nodes.cuh</a></li>
<li>D:/C Program/Simple-CPP-DL-Framework/src/<a class="el" href="_nodes_8cu_source.html">Nodes.cu</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
